const { createProxyMiddleware } = require('http-proxy-middleware')
module.exports = function (app) {
    app.use(
        createProxyMiddleware('/api', {
            target: 'https://apis.netstart.cn',
            changeOrigin: true,
            secure: false,
            pathRewrite: { '^/api': '' }
        }),
        createProxyMiddleware('/bpi', {
            target: 'https://apis.map.qq.com',
            changeOrigin: true,
            secure: false,
            pathRewrite: { '^/bpi': '' }
        }),
        createProxyMiddleware('/cpi', {
            target: 'http://localhost:3001',
            changeOrigin: true,
            secure: false,
            pathRewrite: { '^/cpi': '' }
        })
    )
}